FROM ubuntu:20.04
ENV TZ=Asia/Shanghai
RUN sed -i 's/archive.ubuntu/mirrors.aliyun/g' /etc/apt/sources.list \
  && apt update \
  && DEBIAN_FRONTEND="noninteractive" apt install -y apache2 php7.4 libapache2-mod-fcgid cgi-mapserver mapserver-bin libapache2-mod-php \
  && a2enmod authnz_fcgi \
  && a2enmod cgi \
  && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \
  && cd /usr/lib/cgi-bin \
  && ln -s ../../bin/mapserv mapserv.exe
EXPOSE 80
CMD ["apachectl", "-D", "FOREGROUND"]
